package praca.impl;

public class Point implements Comparable<Point>{
	Integer posX;
	Integer posY;
	
	public Point(int x, int y){
		this.posX=x;
		this.posY=y;
	}

	public int getPosX() {
		return posX;
	}

	public void setPosX(int posX) {
		this.posX = posX;
	}

	public int getPosY() {
		return posY;
	}

	public void setPosY(int posY) {
		this.posY = posY;
	}

	@Override
	public int compareTo(Point another) {
		 int theY = this.posY.compareTo(another.posY);
	     return theY == 0 ? this.posX.compareTo(another.posX) : theY;
	}
	
	

}
